<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<link type="text/css" rel="stylesheet" href="css/cityLayout.css"/>
<script type="text/javascript" src="js/cityselect.js"></script>
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.min.css" />
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js" ></script>
<title>Insert title here</title>
<script type="text/javascript">
	$(function(){
		init_city_select($("#citySelect"));
	});
</script>
<style type="text/css">
* {
	margin: 0;
	padding: 0;
}

table {
	border-spacing: 20px;
}

.box2-td {
	text-align: right;
}

#text {
	width: 320px;
}
</style>
</head>
<body style="font-size: 20px;">
	<div class="top" style="padding: 20px 30px 10px; font-size: 16px;">
		<a href="#">会员</a>/
		<a href="#">会员管理</a>/
		<span>编辑会员</span>
	</div>
	<div class="bottom">
		<div class="span12" style="width: 96%;">
		<c:if test="${not empty vip}"><form action="lvip?action=revisevip" method="post"></c:if>
		<c:if test="${empty vip}"><form action="lvip?action=addvip" method="post"></c:if>
			<table class="table">
				<c:if test="${not empty vip}">
					<tr>
						<td style="text-align: right; width: 200px;">用户ID：</td>
						<td><input id="text" type="text" name="u_id" value="${user.getU_id()}" readOnly="true" style="width: 100%;"></td>
					</tr>
				</c:if>
				<tr>
					<td style="text-align: right; width: 200px;">用户名：</td>
					<td><input id="text" type="text" name="u_name" value="${user.getU_name()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">邮箱：</td>
					<td><input id="text" type="text" name="email" value="${vip.getEmail()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">密码：</td>
					<td><input id="text" type="text" name="pwd" value="${user.getPwd()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">确认密码：</td>
					<td><input id="text" type="text" name="ok_pwd" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">会员组：</td>
					<td>
						<c:if test="${empty vip}">
							<select name="viplist_id" style="width:100px;">
								<option value="设置会员组">设置会员组</option>
								<c:forEach items="${list}" var="u" varStatus="vs">
									<option value="${u.id}">${u.getViplist_name()}</option>
								</c:forEach>
							</select>
						</c:if>
						<c:if test="${not empty vip}">
							<select name="viplist_id" style="width:100px;">
								<option value="设置会员组">设置会员组</option>
								<c:forEach items="${list}" var="u" varStatus="vs">
									<option value="${u.id}" ${vip.getViplist_id() eq u.id? 'selected = "selected"':''}>${u.getViplist_name()}</option>
								</c:forEach>
							</select>
						</c:if>
					</td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">姓名：</td>
					<td><input id="text" type="text" name="v_name" value="${vip.getVname()}"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">性别：</td>
					<td>
						<input type="radio" name="sex" value="0" ${vip.getSex() eq 0? 'checked="checked"':''}>男
						<input type="radio" name="sex" value="1" ${vip.getSex() eq 1? 'checked="checked"':''}>女
					</td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">电话：</td>
					<td><input id="text" type="text" name="tel" value="${vip.getTel()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">手机：</td>
					<td><input id="text" type="text" name="phone" value="${vip.getPhone()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">地区：</td>
					<td>
						<input id="citySelect" name="a_name" type="text" value="${vip.getAname() }"  class="city_input" >
					</td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">地址：</td>
					<td><input id="text" type="text" name="address" value="${vip.getAddress()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">邮编：</td>
					<td><input id="text" type="text" name="zipcode" value="${vip.getZipcode()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">QQ：</td>
					<td><input id="text" type="text" name="qq" value="${vip.getQq()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">积分：</td>
					<td><input id="text" type="text" name="integral" value="${vip.getIntegral()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td style="text-align: right; width: 200px;">生日：</td>
					<td><input id="text" type="date" name="born" value="${vip.getBorn()}" style="width: 100%;"></td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: center;"><input type="submit" value="确定" style="width: 100px;"></td>
				</tr>
			</table>
		</form>
		</div>
	</div>
</body>
</html>